package com.yc.service.system.hospital.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yc.dao.DaoSupport;
import com.yc.entity.Page;
import com.yc.service.system.hospital.IHospitalManager;
import com.yc.util.PageData;


@Service
public class HospitalManager implements IHospitalManager {

	@Resource(name = "daoSupport")
	private DaoSupport dao;

	@Override
	public List<PageData> getHospitalList(Page page) throws Exception {
		// TODO Auto-generated method stub
		return (List<PageData>) dao.findForList("HospitalMapper.hospitallistPage", page);
	}
	
	@Override
	public List<PageData> getAllHospital(Page page) throws Exception {
		// TODO Auto-generated method stub
		return (List<PageData>) dao.findForList("HospitalMapper.hospitalList", page);
	}
	
	
	
	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		dao.save("HospitalMapper.save", pd);
	}
	
	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		dao.update("HospitalMapper.edit", pd);
	}
	
	
	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		dao.delete("HospitalMapper.delete", pd);
	}
	
	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return (PageData)dao.findForObject("HospitalMapper.findById", pd);
	}
	
}
